// 1 安装插件js-cookie  yarn add js-cookie

// 2. 导入Cookies
import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'

// Cookies和localStroage的区别

// 获取token
export function getToken() {
  // Cookies.get(key)
  return Cookies.get(TokenKey)
}

// 存储token   Cookies.set(key)
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// 删除token   Cookies.remove(key)
export function removeToken() {
  return Cookies.remove(TokenKey)
}
